<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" lang="en">
<head th:include="header::header"></head>
<style type="text/css">
	th,td{
		text-align: left!important;
		widows: 160px!important;
		padding-left: 10px;
	}
	.LineTitle .Line_on {
    color: #3f3f3f;
    border-bottom: none;
	
	}
	.integral{
		text-align: left!important;
		color:#cd5041!important;
		width: 75px!important;
	}
	.LT1{
		height: 108px!important;
		line-height: 20px!important;
		
	}
	.LT1 p{
		min-width:700px;
	height:12px;font-size: 12px;
		color: #3f3f3f;
		margin-top: 20px;
		margin-left: 17px;}
	.lt2{
		border-bottom: 1px solid #f0f0f0;	
	}

	.LineTitle a{
		width: 98px;
		height: 38px;
		border:1px solid #cecece;
		border-radius: 4px; 
		display: block;
		color: #3f3f3f;
		text-align: center;
		line-height: 38px;
		float: right;
		margin-top: 19px;
		margin-right: 39px;
		background: #fafafa;
		font-size: 14px;
	}
	.LineTitle a:after{
		   content:".";        
     display:block;        
     height:0;        
     clear:both;        
     visibility:hidden;
	}
	.disabled{
		background: #f8f8f8!important;
	}
	</style>
<body>
	<!-- 顶部导航条-->
	<div th:include="personal/personalhead::order-personalhead-nav"></div>
	<!-- 顶部搜索栏部分 -->
	<div th:include="personal/personalsearch::order-personalsearch-nav"></div>
	<!--个人中心中间主体框架  -->
	<div class="centerbody personal_middle">
		<!-- 左侧通用导航栏开始 -->
		<div class="personal_middle_nav" th:include="commonfragment::order-left-menu-nav"></div>
		<!-- 左侧通用导航栏结束 -->
		<div class="personal_middle_main">
			<div class="personal_middle_main_tit">
				<span>资产中心</span>><span>我的积分</span>><span>提现</span>
			</div>
			<div data-role="page">
        		<div data-role = "content-floud">
					<div class="publicBox pb1">
						<div class="LineTitle clear LT1">
						<p style="font-weight: bold;">积分提现说明</p>
						<p>1、商城中的可用积分与金额之间的转换：1可用积分=1元；</p>
						<p>2、可用积分大于等于100才可提现，单笔最高10000元，每日累计提现限额10000元，手续费直接从提现金额中进行扣除；</p>
						<p>3、目前仅支持提现到银行卡账户，每次提现手续费5元；</p>
						<p>4、提现到账时间，正常情况下为T+1；</p>
						<p>备注：</p>
						<p>请各位普惠会员本着诚信的原则，在申请提现前请仔细核对自己的积分，若账户可用积分来源有问题，</p>
						<p>如系统漏洞增加的积分或者其他非正常手段获得的积分，请勿申请提现。平台将会核查每个提现账户的</p>
						<p>每一笔积分，存在问题的账户将承担相应的责任。</p>
						</div>
					</div>
				</div>
			</div>
			<div data-role="page">
        		<div data-role = "content-floud">
					<div class="publicBox" th:if="${memberInfo!=null}">
						<div class="LineTitle clear lt2"><span>积分明细</span></div>
							<div class="realName pad_20">
							    <form id="cashForm" th:object="${memberInfo}" action="/score/cash" method="POST">
							    	<input type="hidden" th:value="*{id}" name="id" id="memberId">
									<p class="realNameForm"><label>账户名称：</label><input type="text" th:value="*{realName}" name="realName" placeholder="自动获取" disabled="disabled" class="disabled"></p>
									<p class="realNameForm"><label>银行卡号：</label><input type="text" th:value="*{bankCard}" name="bankCard" placeholder="自动获取" disabled="disabled" class="disabled"></p>
									<p class="realNameForm"><label>提现积分：</label><input type="text" name="cashScore" class="validate[required,min[1],custom[number]]" id="cashScore" placeholder="请输入要提现的积分"><span style="margin-left:20px" >可用积分：</span><span style="color:#cd5242" id="enableScore" th:text="*{score}"></span></p>
									<p class="realNameForm"><label>提现金额：</label><input type="text" name="cashMoney" id="cashMoney" placeholder="根据积分自动换算" disabled="disabled" class="disabled"></p>
									<p class="realNameForm"><label>支付密码：</label><input type="password" name="payPwd" class="validate[required,minSize[6],maxSize[6]]" id="payPwd" placeholder="请输入6位数支付密码"><a th:href="@{/member/loadRetrievePassword}" style="margin-left:20px;color:#48aafd;">忘记密码？</a></p>
									<p class="realNameForm"><label>手机验证码：</label><span class="reaCodeBox"><input class="realTxtCode" type="text" name="msgCode" id="msgCode" placeholder="请输入验证码"><em class="realNameCode">获取验证码</em></span></p>
									<p class="realNameBut"><button id="saveBtn" type="button">确认提现</button></p>
								</form>
							</div><!--LineConf-->
					</div>
					<div class="publicBox" th:if="${memberInfo==null}">
						<div class="realName pad_20">
							<p><span th:text="${msg}"></span></p>
						</div>
					</div>
				</div>
   			 </div>
		</div>
		<div style="clear:both;"></div>
	</div>
	
	<!-- footer通用引入 -->
	<div th:include="footer::footer"></div>
</body>
<script type="text/javascript">
	$('#socre_iden').css('display','block');
	$('a.personal_box_tit_link').eq(1).addClass('banner_choose').siblings().removeClass('banner_choose');
	$(function(){

	/*tab标签切换*/
    function tabs(tabTit,on,tabCon){
        $(tabCon).each(function(){
            $(this).children().eq(0).show();
        });
        $(tabTit).each(function(){
            $(this).children().eq(0).addClass(on);
        });
        $(tabTit).children().click(function(){
            $(this).addClass(on).siblings().removeClass(on);
            var index = $(tabTit).children().index(this);
            $(tabCon).children().eq(index).show().siblings().hide();
        });
     }
     //获取短信验证码
     var validCode=true;
     $(".realNameCode").click (function(){
     var time=60;
     var code=$(this);
     if (validCode) {
       validCode=false;
       //获取验证码
  	   $.ajax({
  		  url:"/score/sendSmsCode?memberId="+$('#memberId').val(),
  		  type:"GET",
  		  dataType:"json",
  		  error:function(){
  			layer.alert("系统繁忙，请稍后再试！");
  		  },
  		  success:function(data){
  			if(data.success){
  				layer.alert("验证码已发送！",{icon: 1});
  			}else{
  				layer.alert("验证码发送失败！",{icon: 2});
  			}
		  }
  	   });
       code.addClass("msgs1");
       var t=setInterval(function  () {
           time--;
           code.html(time+"秒");
           if (time==0) {
               clearInterval(t);
               code.html("重新获取");
               validCode=true;
               code.removeClass("msgs1");
           }
        },1000)
      }
    });

    tabs(".LineTitle","Line_on",".LineCon");

   	$("#cashForm").validationEngine({ 
   		promptPosition: "topRight", 
   		validationEventTriggers:"keyup blur", 
   		success :  false,
   		failure : function() { callFailFunction()  }
   	});
   	
    //提交
    $("#saveBtn").click(function(){
    	var flag = $("#cashForm").validationEngine("validate");
		if(!flag){
	 		return false;
		}
		layer.msg('数据保存中',{icon:16,shade:-1,time:-1});
		$("#cashForm").submit();
    });
    
    $("#cashScore").change(function(){
    	var cashScore=$("#cashScore").val();
    	var enableScore=$("#enableScore").text();
    	if(parseInt(cashScore)>parseInt(enableScore)){
    		layer.alert('提现积分不能大于可用积分',{icon: 2});
    		return;
    	}
    	$("#cashMoney").val(cashScore);
    });
})
</script>
</html>